<?php

declare(strict_types=1);

namespace App\Http\Controllers;

use App\Inc\OrderInc;
use App\Services\AdvertService;
use App\Services\api\ILocationService;
use App\Services\CitySettingsService;
use App\Services\HomepageService;
use App\Services\ProductService;
use App\Services\SystemSettingsService;
use App\Utils\RegisterReceiveCouponRemindPageUtil;
use App\VO\Homepage\Builder as HomepageVOBuilder;
use Illuminate\Http\Request;

class ProductsController extends BaseController
{
    /**
     * @param Request $request
     *
     * @api {get} /products 首页
     * @apiVersion 0.0.0
     * @apiName /products
     * @apiGroup Product
     * @apiDescription 首页
     *
     * @apiSuccessExample {json} success:
     *     {"code":200,"message":"ok","data":{"hot":[{"id":1,"btype":19,"product_buy_num_left_desc":"\u670d\u52a1\u65f6\u957f","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"pay\/2020\/09\/12\/9452d0eb93ca97927e1fece63b68c9829174.png","product_open_city_config":0,"product_show_type":1,"product_category_id":1,"title":"\u65e5\u5e38\u4fdd\u6d01","specification":"\u5c0f\u65f62222","description":"","image":"pay\/2019\/11\/26\/\u56fe\u5c42634@2x.png","order_image":"pay\/2019\/11\/29\/\u65e5\u5e38.png","on_sale":1,"price":"45.00","old_price":"45.00","citys":"1,600,1207,1622,178","created_at":"2019-04-29 23:18:10","updated_at":"2020-09-12 10:42:25","sort":0,"least_service_minute":60,"is_show":1,"hot_on_image":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/12\/9452d0eb93ca97927e1fece63b68c9829174.png","banner1_image":"\/home\/images\/index_about\/banner2.png","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"","reginal_desc":"","product_id":1},{"id":2,"btype":101,"product_buy_num_left_desc":"6","product_pid":0,"product_city":0,"product_desc":"\u6309\u5c45\u5ba4\u6536\u8d39\u3001\u7701\u53bb\u6d4b\u91cf\u3001\u6ca1\u6709\u8bef\u5dee","product_menu_image":"pay\/2020\/04\/23\/1ff33756d41a9219aa30a4a20ea4567c462.jpg","product_open_city_config":0,"product_show_type":1,"product_category_id":1,"title":"\u64e6\u73bb\u7483","specification":"\u7231\u5230","description":"","image":"pay\/2019\/11\/08\/\u56fe\u5c42 643.jpg","order_image":"pay\/2019\/11\/29\/\u64e6\u73bb\u7483.png","on_sale":1,"price":"111.00","old_price":"12.00","citys":"1,178,540,600,1207,2232","created_at":"2019-04-29 23:19:16","updated_at":"2020-07-21 12:12:19","sort":9,"least_service_minute":60,"is_show":1,"hot_on_image":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/04\/23\/1ff33756d41a9219aa30a4a20ea4567c462.jpg","banner1_image":"","recommend_left1_image":"\/home\/images\/index_about\/c1@2x.png","recommend_left2_image":"\/home\/images\/index_about\/tuijian.png","recommend_right1_image":"\/home\/images\/index_about\/c2@2x.png","recommend_right2_image":"\/home\/images\/index_about\/c3@2x.png","product_unit":"\u5143\/\u8d77","recommend_double11_image":"\/home\/images\/caboli-11.png","satisfaction_rate":"99","chuman_shajun_taocan_image":"","reginal_image":"","reginal_desc":"","product_id":2},{"id":16,"btype":102,"product_buy_num_left_desc":"\u670d\u52a1\u6570\u91cf","product_pid":0,"product_city":0,"product_desc":"\u5168\u9762\u62c6\u5378\u3001\u6df1\u5ea6\u6e05\u6d01\u3001\u6cb9\u6c61\u514b\u661f","product_menu_image":"pay\/2020\/03\/10\/8b88c29682c4e11e00b00918b9fe0c4a3052.png","product_open_city_config":0,"product_show_type":1,"product_category_id":2,"title":"\u6cb9\u70df\u673a\u6e05\u6d17","specification":"","description":"","image":"pay\/2019\/11\/08\/\u56fe\u5c42 634.jpg","order_image":"pay\/2019\/11\/29\/\u6cb9\u70df\u673a.png","on_sale":1,"price":"111.00","old_price":"160.00","citys":"1,600,1207,178","created_at":"2019-10-28 15:44:18","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":90,"is_show":1,"hot_on_image":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/03\/10\/8b88c29682c4e11e00b00918b9fe0c4a3052.png","banner1_image":"","recommend_left1_image":"\/home\/images\/index_about\/y1@2x.png","recommend_left2_image":"\/home\/images\/index_about\/tuijian.png","recommend_right1_image":"\/home\/images\/index_about\/y2@2x.png","recommend_right2_image":"\/home\/images\/index_about\/y3@2x.png","product_unit":"\u5143\/\u53f0","recommend_double11_image":"\/home\/images\/youyanji-11.png","satisfaction_rate":"99","chuman_shajun_taocan_image":"","reginal_image":"","reginal_desc":"","product_id":16},{"id":20,"btype":106,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"\/home\/images\/index_service_icon\/chuman.png","product_open_city_config":0,"product_show_type":2,"product_category_id":1,"title":"\u9664\u87a8\u6740\u83cc","specification":"\u9664\u87a8\u89c4\u683c","description":"","image":"pay\/2019\/11\/08\/\u56fe\u5c42 647.jpg","order_image":"pay\/2019\/11\/08\/35d6d72cb99641d71a5af28bd39b1bbd.png","on_sale":1,"price":"0.00","old_price":"299.00","citys":"1,600,1207","created_at":"2019-11-04 20:02:28","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":40,"is_show":1,"hot_on_image":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/\/home\/images\/index_service_icon\/chuman.png","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"","reginal_desc":"","product_id":20},{"id":24,"btype":110,"product_buy_num_left_desc":"\u5df2\u9009\u670d\u52a1","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"pay\/2019\/12\/29\/d1a72736d79c40c87398546e2c2e33c98082.png","product_open_city_config":0,"product_show_type":2,"product_category_id":2,"title":"\u7a7a\u8c03\u6e05\u6d17","specification":"","description":"","image":"pay\/2019\/12\/19\/\u56fe\u5c42690@2x.png","order_image":"pay\/2019\/12\/19\/\u7a7a\u8c03\u6e05\u6d17.png","on_sale":1,"price":"80.00","old_price":"80.00","citys":"178","created_at":"2019-11-11 14:20:49","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":30,"is_show":1,"hot_on_image":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2019\/12\/29\/d1a72736d79c40c87398546e2c2e33c98082.png","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"","reginal_desc":"","product_id":24}],"jiadianChuman":[{"id":21,"btype":107,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"","product_open_city_config":0,"product_show_type":0,"product_category_id":0,"title":"\u5bb6\u7535\u6e05\u6d17\u5957\u9910","specification":"","description":"","image":"pay\/2019\/11\/08\/\u56fe\u5c42 651.jpg","order_image":"pay\/2019\/11\/08\/\u5bb6\u7535\u5957\u9910@2x.png","on_sale":2,"price":"0.00","old_price":"","citys":"1,600,1207","created_at":"2019-11-04 20:03:46","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":120,"is_show":0,"hot_on_image":"","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"\/home\/images\/jiadian@2x.png","reginal_image":"","reginal_desc":""},{"id":22,"btype":108,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"","product_open_city_config":0,"product_show_type":0,"product_category_id":0,"title":"\u9664\u87a8\u6740\u83cc\u5957\u9910","specification":"","description":"","image":"pay\/2019\/11\/08\/cba7572986abd4e971c646dd0a8350b3.jpg","order_image":"pay\/2019\/11\/08\/\u9664\u87a8\u5957\u9910@2x.png","on_sale":2,"price":"0.00","old_price":"","citys":"1,600,1207","created_at":"2019-11-04 20:06:30","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":60,"is_show":0,"hot_on_image":"","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"\/home\/images\/chuman@2x.png","reginal_image":"","reginal_desc":""}],"reginal":[{"id":25,"btype":111,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"","product_open_city_config":0,"product_show_type":0,"product_category_id":0,"title":"\u53a8\u623f\u4fdd\u6d01","specification":"","description":"","image":"\u4ea7\u54c1\u8be6\u60c5\u9875banner","order_image":"\u8d2d\u7269\u8f66, \u8ba2\u5355\u5217\u8868\u56fe\u7247","on_sale":2,"price":"100.00","old_price":"","citys":"1,178,540,600,1207,2232","created_at":"2019-11-11 14:22:57","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":60,"is_show":0,"hot_on_image":"","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"\/home\/images\/index_about\/chufang.png","reginal_desc":"\u4e13\u4e1a\u89e3\u51b3\u91cd\u6cb9\u6c61"},{"id":26,"btype":112,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"","product_open_city_config":0,"product_show_type":0,"product_category_id":0,"title":"\u536b\u751f\u95f4\u4fdd\u6d01","specification":"","description":"","image":"\u4ea7\u54c1\u8be6\u60c5\u9875banner","order_image":"\u8d2d\u7269\u8f66, \u8ba2\u5355\u5217\u8868\u56fe\u7247","on_sale":2,"price":"80.00","old_price":"","citys":"1,178,540,600,1207,2232","created_at":"2019-11-11 14:25:41","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":60,"is_show":0,"hot_on_image":"","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"\/home\/images\/index_about\/weishengjian.png","reginal_desc":"\u53bb\u5473 \u6740\u83cc \u6d88\u6bd2"},{"id":27,"btype":113,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"","product_open_city_config":0,"product_show_type":0,"product_category_id":0,"title":"\u5367\u5ba4\u4fdd\u6d01","specification":"","description":"","image":"\u4ea7\u54c1\u8be6\u60c5\u9875banner","order_image":"\u8d2d\u7269\u8f66, \u8ba2\u5355\u5217\u8868\u56fe\u7247","on_sale":2,"price":"60.00","old_price":"","citys":"1,178,540,600,1207,2232","created_at":"2019-11-11 14:26:35","updated_at":"2020-07-21 12:12:19","sort":0,"least_service_minute":60,"is_show":0,"hot_on_image":"","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"\/home\/images\/index_about\/woshi.png","reginal_desc":"\u4ef7\u683c\u670d\u52a1\u53cc\u8212\u5fc3"},{"id":28,"btype":114,"product_buy_num_left_desc":"","product_pid":0,"product_city":0,"product_desc":"","product_menu_image":"","product_open_city_config":0,"product_show_type":0,"product_category_id":0,"title":"\u9633\u53f0\u4fdd\u6d01","specification":"","description":"","image":"\u4ea7\u54c1\u8be6\u60c5\u9875banner","order_image":"\u8d2d\u7269\u8f66,\u8ba2\u5355\u5217\u8868\u56fe\u7247","on_sale":2,"price":"40.00","old_price":"","citys":"1,178,540,600,1207,2232","created_at":"2019-11-11 14:27:54","updated_at":"2020-07-21 12:12:20","sort":0,"least_service_minute":60,"is_show":0,"hot_on_image":"","banner1_image":"","recommend_left1_image":"","recommend_left2_image":"","recommend_right1_image":"","recommend_right2_image":"","product_unit":"","recommend_double11_image":"","satisfaction_rate":"","chuman_shajun_taocan_image":"","reginal_image":"\/home\/images\/index_about\/yangtai.png","reginal_desc":"\u4e13\u4e1a\u8d34\u5fc3\u670d\u52a1"}],"recommend":[{"id":171,"text1":"\u65e5\u5e38\u4fdd\u6d01","text2":"360\u5ea6\u5168\u65b9\u4f4d\u4fdd\u6d01\u3001\u5f52\u7eb3\u6574\u7406","text3":"45\u5143\/\u5c0f\u65f6","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/14\/8079046fb0193cacc4a20b79f44116107971.jpg","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/14\/4ed75737ef49afd05c171a648fb11e851189.png","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/14\/05082d4ef20b1c5053df1129584e10231474.jpg","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/14\/ce2cd4044d000cf0575794b31ab6c2dc8770.jpg","image5":"","link_url":"","city_id":1,"product_id":1,"sort_weight":5,"hidden":0},{"id":170,"text1":"\u6d4b\u8bd5\u5957\u99102\u9996\u9875\u6807\u9898","text2":"\u6d4b\u8bd5\u5957\u99102\u9996\u9875\u914d\u7f6e\u63cf\u8ff0","text3":"210","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/16a72fb95447fc05c8c89e125e9a1aaf5804.png","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/ba73f2c9b3c42b82b51458e8277321ba9349.png","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/ff580606d5c6525e64474a2a4a58575d675.png","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/83d7c51b58878d9d5ae6db67715b82ce6040.png","image5":"","link_url":"","city_id":1,"product_id":154,"sort_weight":2,"hidden":0},{"id":172,"text1":"\u9996\u9875\u63a8\u8350\u670d\u52a1\u6807\u9898","text2":"\u9996\u9875\u63a8\u8350\u670d\u52a1\u63cf\u8ff0","text3":"10000","text4":"9000","text5":"\u5176\u4ed6","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/17\/c3fd9d7a9189257cb7e40ae1ba8a21643719.png","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/17\/4908c5058f62143d1708cafbc635a3c56516.png","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/17\/91d5422f8aac1b34f33985966fd9aade248.png","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/09\/17\/95fb8c870eb6b3b828bb21cf1bffa7c68912.png","image5":"","link_url":"","city_id":1,"product_id":172,"sort_weight":2,"hidden":0},{"id":167,"text1":"\u5317\u4eac\u70ed\u6c34\u5668\u6e05\u6d17","text2":"\u5317\u4eac\u70ed\u6c34\u5668\u6e05\u6d173333","text3":"90","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/8d769c5ed5c272d867efb79877cd87e2980.jpg","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/3c7f002a7127bae0320a40d672f86fde4994.png","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/ee476121541463cc1e16d081a693cbf58620.jpg","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/ba91e4ab422abd3bd707ac2572f3ecfe6414.jpg","image5":"","link_url":"","city_id":1,"product_id":30,"sort_weight":0,"hidden":0},{"id":168,"text1":"aaa","text2":"aaa","text3":"11","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/07\/25\/03da2231639426f73befbd5cdd01e3b5762.jpg","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/07\/25\/cdebdf8372b43f5d72d67c2fffae93b11218.jpg","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/07\/25\/250561c54ad97ecdd45c2ac7d100e51a1198.jpg","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/07\/25\/045d21fcc0bca58b06029ac555baa97b3353.jpg","image5":"","link_url":"","city_id":1,"product_id":77,"sort_weight":0,"hidden":0},{"id":169,"text1":"\u6d4b\u8bd5\u5957\u9910","text2":"\u6d4b\u8bd5\u5957\u9910","text3":"218","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/0ee4745870e136b28adbef8eb2df9bed2243.jpg","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/5d1365532a4230dba169018caef880347848.png","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/2a40c276792599cba61b80f3c90de0272872.jpg","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/08\/24\/635d0febccfcddd224c5b2731b4f1ad04513.jpg","image5":"","link_url":"","city_id":1,"product_id":153,"sort_weight":0,"hidden":0}],"combo":[{"id":73,"text1":"\u82b1\u5927\u5783\u573e\u888b","text2":"","text3":"","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/e2246f35fc1b381aa495bda6adc0da069807.jpg","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/c1633fbf425f8e1b3ce6956cd5af1e2f6018.jpg","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/3443c1f67c8ea0daccffd706dc9ac13b327.jpg","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/a11cebc676fa77d6a1db457b2fb38bc0667.jpg","image5":"","link_url":"","city_id":1,"sort_weight":0,"hidden":0,"start_datetime":0,"end_datetime":0,"origin_price":"0.00","lower_price":"199.00"},{"id":78,"text1":"aaaa","text2":"","text3":"","text4":"","text5":"","image1":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/3718502f8dccdf96bc61991b43c5d52d3344.jpg","image2":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/d9abc5a57dbb5fa8348e08bf01fb5b413248.jpg","image3":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/3304bd7ab6291e13f5c44fca0dc339ff4189.jpg","image4":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/14\/1938ab7a44e5072194bd6950ffc99e709406.jpg","image5":"","link_url":"55","city_id":1,"sort_weight":0,"hidden":0,"start_datetime":0,"end_datetime":0,"origin_price":"0.00","lower_price":"2.00"}],"location":{"id":1,"areaname":"\u5317\u4eac\u5e02","level":1,"parentid":0,"is_open":1},"ad":[{"id":270,"advert_id":15,"advert_title":"\u9996\u9875banner","advert_url":"","image":"","created_at":"2020-09-18 15:45:10","updated_at":null,"advert_status":1,"advert_sort":1,"upper_lower_status":1,"upper_time":null,"lower_time":null,"advert_url_type":1,"product_id":0}],"isDouble11":0,"showRemindPage":false,"sysMain":{"sys_name":"\u9e3f\u5a75\u4fe1\u606f\u79d1\u6280\u6709\u9650\u516c\u53f8","sys_logo":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/12\/50ba889f92a1dbd15e6112bf7b6685199355.jpg","sys_slogan":"\u54c1\u8d28\u751f\u6d3b\uff0c\u9009\u9e3f\u5a75\u4fe1\u606f\u79d1\u6280\u6709\u9650\u516c\u53f8","sys_intro":"\u4e92\u8054\u7f51\u5bb6\u653f-\u4fdd\u6d01-o2o\u670d\u52a1\uff08\u7cfb\u7edf\u7b80\u4ecb\uff09","wxshare_title":"\u54c1\u8d28\u9e3f\u5a75\u4fe1\u606f\u79d1\u6280\u6709\u9650\u516c\u53f8","wxshare_desc":"\u4e92\u8054\u7f51\u5bb6\u653f-\u4fdd\u6d01-o2o\u670d\u52a1\uff08\u5206\u4eab\u63cf\u8ff0\uff09","wxshare_image":"http:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/pay\/2020\/05\/13\/632a3972cd652d0aa69344f718c15f939069.jpg"},"sysDefaults":{"id":1,"city_id":0,"enabled":1,"service_hour_start":"8.0","service_hour_end":"22.0","service_interval":"0.5","service_weekdays":[1,2,3,4,5,6],"reservation_hour":"24.0","phone_number":"400-6886758","show_phone":1,"reservation_day_limit":10,"busyPeriods":[{"id":69,"city_id":0,"start_time":"12:00","end_time":"14:00"},{"id":70,"city_id":0,"start_time":"18:00","end_time":"19:00"}]},"cityInfo":{"id":1,"areaname":"\u5317\u4eac\u5e02","level":1,"parentid":0,"is_open":1},"citySettings":{"id":1,"city_id":0,"enabled":1,"service_hour_start":"8.0","service_hour_end":"22.0","service_interval":"0.5","service_weekdays":[1,2,3,4,5,6],"reservation_hour":"24.0","phone_number":"400-6886758","show_phone":1,"reservation_day_limit":10,"busyPeriods":[{"id":61,"city_id":1,"start_time":"12:00","end_time":"14:00"},{"id":62,"city_id":1,"start_time":"18:00","end_time":"19:00"}]},"isGuessLocation":0,"hotItemShowCount":4,"extraValues":[{"type":"path","path":"\/pages\/equityCard\/equityCard","title":"\u5c45\u5bb6\u6743\u76ca\u5361","desc":"\u5341\u4f59\u79cd\u670d\u52a1\u4efb\u9009","image":"https:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/public\/uploads\/ljsh_C\/jiajuka.png"},{"type":"product","title":"\u6df1\u5ea6\u4fdd\u6d01","desc":"\u5168\u65b9\u4f4d\u6df1\u5ea6\u4fdd\u6d01\u6d88\u6bd2","image":"https:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/public\/uploads\/ljsh_C\/chuman.png","params":{"id":16}},{"type":"product","title":"\u6cb9\u70df\u673a\u62c6\u6d17","desc":"\u91cd\u6cb9\u6c61\u6e05\u6d01\u6362\u65b0","image":"https:\/\/ljsh.oss-cn-beijing.aliyuncs.com\/public\/uploads\/ljsh_C\/chouyanji.png","params":{"id":1}}],"tel":"4006886758"}}
     * @apiErrorExample {json} fail:
     *     {"code":201,"message":"FAILED"}
     */
    /**
     * @param Request $request
     * @param ILocationService $locationService
     * @return \Illuminate\Http\JsonResponse
     */
    public function index(Request $request, ILocationService $locationService)
    {
        //获取城市信息
        $cityId = $this->getUserLocationCityId();
        $areaEntity = $locationService->getCityById($cityId);
        //获取广告图片
        $advertImage = (new AdvertService())->getAd($areaEntity->getId(), OrderInc::POSITION_首页顶部);
        //获取相关模块产品
        $productService            = new ProductService();
        $hot                       = $productService->getIndexProducts('hot', $cityId); //热门服务
        $jiadianChuman             = $productService->getIndexProducts('jiadianchuman', $cityId); //家电清洗套餐,除螨杀菌套餐
        $reginal                   = $productService->getIndexProducts('reginal', $cityId); //区域保洁
        $recommend                 = (new HomepageService())->getCityRecommendList($cityId);
        $combo                     = (new HomepageService())->getCityComboList($cityId);
        [$sysMain, $sysDefaults]   = (new SystemSettingsService())->getSysSettings();
        [$cityInfo, $citySettings] = (new CitySettingsService())->getCitySettings($cityId, true, true);
        $extraValues               = (new HomepageService())->getHomepageExtraValues();

        $vo = (new HomepageVOBuilder())->buildDetail([
            'hot'               => $hot,
            'jiadianChuman'     => $jiadianChuman,
            'reginal'           => $reginal,
            'recommend'         => $recommend,
            'combo'             => $combo,
            'location'          => $areaEntity->toArray(),
            'ad'                => $advertImage,
            'isDouble11'        => 0,
            'showRemindPage'    => RegisterReceiveCouponRemindPageUtil::isShow(),
            'sysMain'           => $sysMain,
            'sysDefaults'       => $sysDefaults,
            'cityInfo'          => $cityInfo,
            'citySettings'      => $citySettings,
            'isGuessLocation'   => self::$isGuessLocation,
            'extraValues'       => $extraValues,
        ]);

        return $this->showJsonResult(200, 'ok', $vo);
    }

    public function cityProductList(Request $request)
    {
        $cityId          = (int) $request->input('city_id');
        $cityProductList = (new ProductService())->getCityProductList($cityId);

        return $this->JsonResult('ok', 0, 200, $cityProductList);
    }
}
